﻿using Application.AppService.HFAppService;
using AutoMapper;
using Domain.Entity;
using Domain;
using Microsoft.AspNetCore.Mvc;

namespace UI.Controllers.Human_resource_file_management_人力资源档案管理_.Human_resources_file_deletion_management_人力资源档案删除管理_
{
	public class HFRecoverController : Controller
	{
		private readonly IMapper mapper;
		private readonly IHFAppService hFAppService;

		public HFRecoverController(IMapper mapper, IHFAppService hFAppService)
		{
			this.mapper = mapper;
			this.hFAppService = hFAppService;
		}
		public IActionResult Index()
		{
			return View();
		}
		public IActionResult Index1()
		{
			return View();
		}
		public IActionResult Index2()
		{
			return View();
		}
		public IActionResult Index3()
		{
			return View();
		}
		public IActionResult Index4()
		{
			return View();
		}
		[HttpPost("FenYeHFRecover")]
		public IActionResult FenYeHFDel(string firstKindName, string secondKindName, string thirdKindName, string majorKindName, string majorName, DateTime startDate, DateTime endDate, int page, int pageSize, int zt1, int zt2)
		{
			HFFenYE hFFenYe = hFAppService.HFFenYEZTAsync(firstKindName, secondKindName, thirdKindName, majorKindName, majorName, startDate, endDate, page, pageSize, zt1, zt2);
			return Json(hFFenYe);
		}
		[HttpPost("FenYeHFRecoverGJZ")]
		public IActionResult FenYeHFGJZ(int page, int pageSize, int zt1, int zt2, string gjz)
		{
			HFFenYE hFFenYe = hFAppService.FenYeHFGJZZTAsync(page, pageSize, zt1, zt2, gjz);
			return Json(hFFenYe);
		}
		[HttpPost("UpdateHFRecoverZT")]
		public async Task<IActionResult> UpdateHF(HF hf)
		{
			hf.HumanFileStatus = 1;
			hf.RecoveryTime = DateTime.Now;
			bool rs = await hFAppService.UpdateHFZTAsync(hf);
			return Json(rs);
		}
	}
}
